<template>
  <div class="home_main_con">
    <div class="left_content primary_color">
      <div class="content">
        <div class="admin_link_con admin_link_con_shadown"/>
        <div class="admin_link_con">
          <a href="#/admin/login" title="后台管理页面" class="iconfont">&#xe605;</a>
        </div>
        <img src="../../assets/head_icon.jpg" class="head_icon" />
        <p class="blog_title">CemCode | Blog</p>
        <p class="shiju_font">{{ this.poem.content }}<br/>{{ this.poem.author }}</p>
        <div class="iconfont_list">
          <a title="QQ联系我" href="tencent://message/?uin=2289538564&Site=www.cemcode.com&Menu=yes" class="iconfont">&#xe6a0;</a><a href="https://github.com/turnturn" title="我的github主页" target="_blank" class="iconfont">&#xe709;</a><a href="https://gitee.com/cemcode" target="_blank" title="我的gitee主页" class="iconfont">&#xe677;</a>
        </div>
        <div class="white_line" />
        <div class="white_line" />
        <ul class="nav_list">
          <li>
            <router-link to="/home/article_list">首页</router-link>
          </li>
          <li>
            <router-link to="/home/pigeonhole">归档</router-link>
          </li>
          <li>
            <router-link to="/home/projects">项目</router-link>
          </li>
          <li>
            <router-link to="/home/gallery">画廊</router-link>
          </li>
          <li>
            <router-link to="/home/leave_message">留言</router-link>
          </li>
          <li>
            <router-link to="/home/friend_link">友链</router-link>
          </li>
          <li>
            <router-link to="/home/about">关于</router-link>
          </li>
        </ul>
      </div>
      <FlowerVue :src="src" :num="nums"></FlowerVue>
      <a class="footer_link" href="https://beian.miit.gov.cn/#/Integrated/index">©2018-2025 by
        CemCode<br />备案号：湘ICP备20013442号-1</a>
    </div>
    <div class="right_content">

      <div class="background_img">
        <router-view></router-view>
      </div>

    </div>
  </div>
</template>
<script>
import axios from 'axios'
import FlowerVue from '@/components/RandomFlower.vue';
export default {
  name: "DeskHome",
  data() {
    return {
      poem: {},
      src: "https://s2.loli.net/2023/12/18/BFX9OebWf5MRd31.png",
      nums: 5,
    }
  },
  components:{FlowerVue},
  mounted() {
    axios.get("https://v1.jinrishici.com/all.json").then(result => {
      console.log("诗词:", result);
      this.poem = result.data
    }).catch(err => {
      console.log(err);
    })
  }
};
</script>
<style lang="scss" scoped>
$primary-color: #00a9ff;
$primary-font-color: white;
$title-font-color: #333;
$message-font-color: #333;
$thin-font-color: #999;

// xiaoping
@media screen and (max-width:600px){
  .home_main_con::-webkit-scrollbar{
    display: none;
  }
  .home_main_con{
    width: 100%;
    height: 100%;
    display: block !important;
    overflow: scroll;

    .right_content{
      display: block;
      min-width: 100%;
      width: 100%;
      height: 100%;
    }

  }
}

.home_main_con {
  width: 100%;
  height: 100%;
  display: flex;

  .left_content {
    background-color: $primary-color;
    min-width: 250px;
    box-shadow: 0 0 10px 0px rgb(173, 173, 173);
    padding-top: 50px;
    font-size: 14px;
    color: $primary-font-color;
    display: flex;
    flex-direction: column;

    >.content {
      display: flex;
      flex-direction: column;
      align-items: center;
      flex: 1 auto;

      .admin_link_con{
        position: absolute;
        z-index: 2;
        width: 0;
        height: 0;
        border: 20px solid rgb(52, 208, 255);
        border-color: rgb(52, 208, 255) transparent transparent rgb(52, 208, 255);
        left: 0;
        top: 0;
          .iconfont{
            position: absolute;
            top: -20px;
            left: -20px;
            z-index: 3;
            color: white !important;
            font-size: 20px;
            text-decoration: none;
          }
          
      }

      .admin_link_con_shadown{
        border: 20px solid #333;
        border-color: #333 transparent transparent #333;
        filter: blur(3px);
      }

      .head_icon {
        width: 100px;
        height: 100px;
        border: 3px solid white;
        border-radius: 50%;
        box-shadow: 0 0 20px 0 #00699e;
        transition: 1s;
      }

      .head_icon:hover {
        animation: headicon_rotate linear infinite 2s;
        cursor: pointer;
      }

      .blog_title {
        margin-top: 50px;
      }

      .shiju_font {
        margin-top: 20px;
        display: inline-block;
        min-width: 100%;
        max-width: 100%;
        padding: 0 0 15px 0;
        text-align: center;
        font-size: 12px;
      }

      .iconfont_list{
        width: 60%;
        display: flex;
        padding: 10px 0;
        justify-content: space-between;
        .iconfont{
          font-size: 35px;
          text-decoration: none;
          color: white;
        }
      }

      .white_line {
        width: 120px;
        height: 2px;
        background-color: white;
        margin-top: 3px;
      }

      .white_line:first-of-type {
        margin-top: 30px;
      }

      .nav_list {
        margin: 20px 0;
        list-style: none;

        >li {
          height: 35px;

          a {
            color: $primary-font-color;
            padding: 0 5px;
            text-decoration: none;
          }

          .router-link-active {
            border-left: 2px solid white;
          }
        }
      }
    }

    .footer_link {
      color: $primary-font-color;
      text-decoration: none;
      font-size: 12px;
      height: 40px;
      transform: scale(0.9);
      display: inline-block;
      width: 100%;
      text-align: center;
    }
  }

  .right_content {
    flex: 1 auto;
    position: relative;
    background-color: rgb(248, 248, 248);
    background-image: linear-gradient(to bottom right, #ade7ff, #d3b8ff);
    .background_img {
      width: 100%;
      height: 100%;
      // background-image: linear-gradient(to bottom right, #cef0ff, #e5d5ff);
      // background-image: url("https://s2.loli.net/2023/12/18/T4ZtuRxLC1qrWKw.png");
      // background-repeat: no-repeat;
      // background-size: 100% 100%;
      position: absolute;
      top: 0;
    }
  }

  @keyframes headicon_rotate {
    0% {
      position: relative;
      top: 0px;
    }

    30% {
      position: relative;
      top: -5px;
    }

    70%{
      position: relative;
      top: 5px;
    }

    100%{
      position: relative;
      top: 0px; 
      transform: rotate(360deg) ;
    }
  }
}
</style>